As a network develops towards big data and intelligence, a network manager needs more means to monitor network behaviors. A conventional Ethernet switch chip reports expected data stream information such as a destination physical address and a packet length to a CPU. In the age of big data, a network latency becomes a very important indicator. The Ethernet switch chip needs to work in a low-latency mode. In other words, the Ethernet switch chip does not need to receive an entire packet, and needs to receive only a small amount of data before sending the data.
The prior art proposes a data stream information extraction method. As shown in FIG. 1, the method includes the following steps: The Ethernet switch chip receives a packet, where the format of the packet conforms to the standard Ethernet protocol, and a data feature parsing module may parse out feature information corresponding to the packet; data stream feature information needing to be extracted is preset in the chip, where the feature information may include multiple pieces of information; a data stream feature comparison module compares the feature information corresponding to the packet received by the chip with the preset feature information, where if matching succeeds, it indicates that the packet belongs to an expected data stream; and information about the packet whose feature information is successfully matched is sent to a module for collecting statistics on data stream information, and the module sends packet information satisfying a requirement to a CPU.
However, by using the foregoing method, when Ethernet switch chip works in the low-latency mode, the information reported to the CPU by the module for collecting statistics on data stream information does not include length information of the packet, but the length information is one of pieces of important information needed by the network manager.